package com.example.xunua_weather.Sqliteutils;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;


public class MySqliteHelper extends SQLiteOpenHelper {

    public MySqliteHelper(Context context){
        super(context, "forcast.db", null, 2);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        String sql="create table info1(_id integer primary key autoincrement,city varchar(20) unique not null,content text not null)";//content：json数据
        db.execSQL(sql);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        String sql="create table info1(_id integer primary key autoincrement,city varchar(20) unique not null,content text not null)";
        db.execSQL(sql);
    }
}
